<script setup>
import { computed, defineEmits, ref } from 'vue'
import SettingNavi from '@/components/attendanceComponents/SettingPage/SettingNavi.vue'

const emits = defineEmits(['goback'])
const goback = () => {
  emits('goback')
}

const content = ref('')
const buttonDisabled = computed(() => {
  return content.value.length === 0
})

const clickSave = () => {
  //todo 保存
  emits('goback')
}
</script>

<template>
  <SettingNavi
    :iconFont="'icon-shuaxin'"
    title="考勤组名称"
    @pageIndexChange="goback"
  />
  <input
    v-model="content"
    class="inputClass"
    placeholder="不超过30个字符"
    type="text"
  />
  <button :disabled="buttonDisabled" class="buttonClass" @click="clickSave">
    完成
  </button>
</template>

<style lang="scss" scoped>
.inputClass {
  display: flex;
  width: 750rpx;
  height: 108rpx;
  padding-left: 32rpx;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 16rpx;
  flex-shrink: 0;
  background: var(---white, #fff);
  margin-top: 40rpx;
}

.buttonClass {
  display: flex;
  width: 686rpx;
  height: 108rpx;
  justify-content: center;
  align-items: center;
  background: #165dff;
  border-radius: 16rpx;
  color: #fff;
  font-size: 32rpx;
  margin: 40rpx 32rpx 0rpx 32rpx;
  overflow: hidden;
}

button[disabled] {
  background: #c9cdd4;
  color: #fff;
}

.container {
  margin: 40rpx 32rpx 0rpx 32rpx;
}

.sectionClass {
  border-radius: 16rpx;
  margin-top: 32rpx;
  overflow: hidden;
}

.textClass {
  color: #86909c;
  font-family: 'PingFang SC';
  font-size: 28rpx;
  font-style: normal;
  font-weight: 400;
  line-height: 39.2rpx;
}
</style>
